package com.ecpss;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class RegTest {
    public static void main(String[] args) {
        String regex = "\\d";
        String input = "12345";
        Pattern pattern = Pattern.compile(regex);
        Matcher matcher = pattern.matcher(input);
        while(matcher.find()){
            System.out.println("Match found: " + matcher.group());
        }
    }
}

/*
运行结果：
Match found: 1
Match found: 2
Match found: 3
Match found: 4
Match found: 5

*/
